﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkflowCore.Interface;
using WorkflowCore.Models;

namespace Workflow2211A.Consol.Steps
{
    public class LoopStep : StepBody
    {
        /// <summary>
        /// 接收循环次数
        /// </summary>
        public int LoopCount { get; set; }
        public override ExecutionResult Run(IStepExecutionContext context)
        {
            ++LoopCount;
            Console.WriteLine("这是第{0}次循环",LoopCount);
            var rand = new Random().Next(2);
            Console.WriteLine($"随机数:{rand}");
            return ExecutionResult.Outcome(rand);
        }
    }
}
